import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import {AtTextarea,AtButton} from 'taro-ui'
import './qunfaxiaoxifasong.scss'
import reactMixin from 'react-mixin';
import myJs from './qunfaxiaoxifasongJs.js'
export default class Qunfaxiaoxifasong extends Component {
    config = {
        navigationBarTitleText: '发送群发消息'
    }
    constructor () { 
        super(...arguments); 
        this.state = this.getData(); 
    }
    init(){
        // this.createMessage();
        this.setState({
            names:this.$router.params.names,
            personNum:this.$router.params.count
        })
    }
    send=()=>{
        this.redirectTo('../qunfazhuangtai/qunfazhuangtai')
    }
    
    render () {
        return (
            <View className='qunfaxiaoxifasong'>
                <View className=' class_0'>
                    <View className=' class_1'>
                        <Text>您将发送消息给{this.state.personNum}位患者</Text>
                    </View>
                    <View className=' class_2'>
                        <Text>{this.state.names}</Text>
                    </View>
                </View>
                <AtTextarea 
                 value={this.state.message.content}
                 placeholder='请输入发送内容' 
                 className=' class_3'
                 onChange={this.handleTextareaChange.bind(this,'message.content')}
                 ></AtTextarea>
                <View className='blank-box'></View>
                <AtButton full type='primary' onClick={this.send} className='send-btn'>发送</AtButton>
            </View>
        );
    }
}
reactMixin.onClass(Qunfaxiaoxifasong,myJs);